﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebApplication3
{
    public partial class WebForm5 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            if (TextBox1.Text=="admin"&&TextBox2.Text=="123")
            {
                Session["UserName"] = TextBox1.Text;
                this.Literal1.Text = "登录成功";
                Response.Redirect("WebForm3.aspx");
            }
            else
            {
                Response.Write("用户或者密码错误");
            }
        }
    }
}